package com.testfileupload.uploadimg.design.observe.define;

import com.testfileupload.uploadimg.design.observe.Observer;

import java.util.Vector;

public abstract class Subject {
    private Vector<Observer> observers = new Vector();

    public void addObserver(Observer observer) {
        this.observers.add(observer);
    }

    public void deleteObserver(Observer observer) {
        this.observers.remove(observer);
    }

    public void notifyObservers(String context) {
        for (Observer observer : observers) {
            observer.update(context);
        }
    }
}
